<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta content="telephone=no" name="format-detection" />
    <!-- 留作将来统一添加 -->
    <TEMPLATE>${TEMPLATE}</TEMPLATE>
    <title>模板html</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/index.css">
    <link rel="stylesheet" type="text/css" href="../../css/data-flex.min.css">
</head>
<body></body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/service/service-tool.js"></script>
<script type="text/javascript" src="../../script/service/service-app.js"></script>
<script type="text/javascript" src="../../script/service/service-user.js"></script>
<script type="text/javascript" src="../../script/service/service-logic.js"></script>
<script type="text/javascript" src="../../script/question/data_parse.js"></script>
<script type="text/javascript" src="../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript">
    // html 的引号一律为双引号(""),js 为单引号('')
    var USER, $S, vm;
    var UIListContacts = null;
    var item = {               
       remark: '艾雪瑞',           //字符串类型；条目的标题，不传则不显示
       phonetic: 'aixuerui',      //字符串类型；标题的拼音表示
    };
    apiready = function(){
        $S = SERVICE();
        USER = USER();
        console.log(JSON.stringify(api.pageParam) + '=====pageParam');

        fnInit();
    };

    // 初始化
    function fnInit() {
        vm = new Vue({
            el: '.vueApp',
            data: {
                info: null,
                listData: [],
                pageNo: 1,
                pageSize: 10
            }
        });
        var list = [];
        for(var i = 0; i < 26; i ++) {
            var temp = deepCopy(item),
                char = getChar(i);
            temp.remark = char + temp.remark;
            temp.phonetic = char + temp.phonetic;

            list.push(temp);
        }
        var temp = deepCopy(item),
                char = '#';
        temp.remark = char + temp.remark;
        temp.phonetic = char + temp.phonetic;
        list.push(temp);
        temp = deepCopy(item);
        char = '%';
        temp.remark = char + temp.remark;
        temp.phonetic = char + temp.phonetic;
        list.push(temp);
        temp = deepCopy(item);
        char = '123';
        temp.remark = char + temp.remark;
        temp.phonetic = char + temp.phonetic;
        list.push(temp);
        // getPageData();
        openContactList(list);
    }

    function openContactList(list) {
        UIListContacts = api.require('UIListContacts');
        UIListContacts.open({
            rect : {
                x : 0,
                y : 0,
                w : api.frameWidth,
                h : api.frameHeight
            },
            contacts: list,
            fixedOn: api.frameName
        }, function(ret) {
            if(ret.eventType == 'click') {
                var one = ret.contact;
                handleItem(one);
            }
        });
    }

    // 获取页面数据
    function getPageData() {
        var url = '';
        var params = {};
        var callback = function(data) {
            var listData = data.listData;
            for(var i = 0; i < listData.length; i ++) {
                var item = listData[i];

            }
            vm.listData = listData;
            // status 为200时,只返回data
        };
        POST(url, params, callback);
    }

    // 点击item
    function handleItem(item) {
        fnOpenPublicWin('学生资料','class/student_info')
    }
</script>
</html>
